<!--
To change this template, choose Tools | Templates
and open the template in the editor.
-->
<!DOCTYPE html>
<?php
session_start();
if ($_SESSION["member"] == null)
    header("location:../web/index.php");
?>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Members</title>
        <style type="text/css">
            .body {
				font-family: "Arial Black", Gadget, sans-serif;
				font-size: 12px;
				font-style: normal;
				color: #000;	
            }
			.header {
				background-image:url(../web/img/panel.png);
				background-repeat:no-repeat;
				background-size:100%;
				max-height:400px;
				min-height:400px;
				height:400px;
			}
            .main_form {
                width: 800px;
                margin-right: auto;
                margin-left: auto;
            }
            .content {
                background-color:#FFF;
            }
			.control_bar {
                width:800px;
                height:50px;
            }

            .button_control {
                -webkit-appearance: none;
				-webkit-border-image: none;
				-webkit-box-align: center;
				-webkit-box-shadow: rgb(255, 255, 255) 0px 1px 0px 0px;
				-webkit-writing-mode: horizontal-tb;
				background-color: rgb(1, 154, 210);
				background-image: linear-gradient(rgb(51, 188, 239), rgb(1, 154, 210));
				background-repeat: repeat-x;
				border-bottom-color: rgb(5, 126, 208);
				border-bottom-style: solid;
				border-bottom-width: 1px;
				border-collapse: collapse;
				border-left-color: rgb(5, 126, 208);
				border-left-style: solid;
				border-left-width: 1px;
				border-right-color: rgb(5, 126, 208);
				border-right-style: solid;
				border-right-width: 1px;
				border-top-color: rgb(5, 126, 208);
				border-top-style: solid;
				border-top-width: 1px;
				box-shadow: rgb(255, 255, 255) 0px 1px 0px 0px;
				box-sizing: border-box;
				cursor: pointer;
				display: block;
				float: right;
				font-family: 'Helvetica Neue', Arial, sans-serif;
				font-size: 13px;
				font-weight: bold;				
				letter-spacing: normal;
				line-height: 18px;
				padding-bottom: 5px;
				padding-left: 10px;
				padding-right: 10px;
				padding-top: 5px;
				position: relative;
				text-align: center;
				text-indent: 0px;
				text-shadow: rgba(0, 0, 0, 0.247059) 0px -1px 1px;
				text-transform: none;
				white-space: nowrap;
				width: 400px;
				height: 40px;
				word-spacing: 0px;
				writing-mode: lr-tb;				
            }
			.button_control a {
			color:#FFF;
			font-size:14px;
			}

            .button_control:hover {
                background-color: rgb(8, 128, 172);
				background-image: linear-gradient(rgb(18, 161, 214), rgb(4, 119, 162));
            }

            .button_control:active {
                background-color: rgb(1, 154, 210);
				background-image: linear-gradient(rgb(51, 188, 239), rgb(1, 154, 210));
            }
            .div_name {
                background-color:#36F;
                width:580px;
                height:40px;
                padding-top:5px;
                padding-left:20px;
                color:#FFF;
                font-size:20px;
                font-weight:bold;
                margin-top:30px;
                margin-left:100px;
            }
            .div_info {
                width:600px;
                padding-top:20px;
                color:#FFF;
                background-color:#3CF;
                margin-left:100px;
            }
            .div_info_row {
                width:460px;
                margin-left:70px;
                font-size:16px;	
                margin-bottom:15px;
            }
            .div_info_left_row {
                width:160px;
                float:left;
                text-align:right;
                font-weight:bold;
            }
            .div_info_right_row {
                width:300px;
                margin-left:180px;
            }
            .table {
                width:560px;
                margin-left:20px;
            }
            .username_row {
                width:200px;
            }
            .age_row {
                width:120px;
            }
            .gender_row {
                width:120px;
            }
            .button {
                width:80px;
                height:30px;
            }       
            a{
                text-decoration: none;
                color:#FFF;
            }
			.slogan {
			font-size:20px;
			font-style:italic;
			color:rgb(19, 136, 210);
			text-align:center;
			margin-bottom:20px;
			}
			.user_item {
			margin-left:auto;
			margin-right:auto;
			width:600px;
			height:100px;
			margin-bottom:10px;
			}
			.user_item_left {
			width: 350px;
			height:100px;
			float:left;
			border-bottom-left-radius: 5px;
			border-top-left-radius: 5px;
			background-color: rgba(0, 0, 0, 0);
				background-image: -webkit-linear-gradient(top, rgb(255, 255, 255) 0px, rgb(221, 221, 221) 100%);
				background-repeat: repeat-x;
				border-bottom-color: rgb(5, 126, 208);
				border-bottom-style: solid;
				border-bottom-width: 1px;
				border-left-color: rgb(5, 126, 208);
				border-left-style: solid;
				border-left-width: 1px;
				border-right-color: rgb(5, 126, 208);
				border-right-style: solid;
				border-right-width: 1px;
				border-top-color: rgb(5, 126, 208);
				border-top-style: solid;
				border-top-width: 1px;
				box-sizing: border-box;				
			}
			.user_item_right {
			width:350px;
			margin-left:250px;
			}
			.user_item_button {
				-webkit-appearance: none;
				-webkit-border-image: none;
				-webkit-box-align: center;
				-webkit-box-shadow: rgb(255, 255, 255) 0px 1px 0px 0px;
				-webkit-writing-mode: horizontal-tb;
				background-color: rgb(1, 154, 210);
				background-image: linear-gradient(rgb(51, 188, 239), rgb(1, 154, 210));
				background-repeat: repeat-x;
				border-bottom-color: rgb(5, 126, 208);
				border-bottom-style: solid;
				border-bottom-width: 1px;
				border-collapse: collapse;
				border-left-color: rgb(5, 126, 208);
				border-left-style: solid;
				border-left-width: 1px;
				border-right-color: rgb(5, 126, 208);
				border-right-style: solid;
				border-right-width: 1px;
				border-top-color: rgb(5, 126, 208);
				border-top-style: solid;
				border-top-width: 1px;
				box-sizing: border-box;
				cursor: pointer;
				display: block;
				float: right;
				font-family: 'Helvetica Neue', Arial, sans-serif;
				font-size: 13px;
				font-weight: bold;				
				letter-spacing: normal;
				line-height: 18px;
				padding-bottom: 5px;
				padding-left: 10px;
				padding-right: 10px;
				padding-top: 5px;
				position: relative;
				text-align: center;
				text-indent: 0px;
				text-shadow: rgba(0, 0, 0, 0.247059) 0px -1px 1px;
				text-transform: none;
				white-space: nowrap;
				width: 250px;
				height: 100px;
				word-spacing: 0px;
				writing-mode: lr-tb;				
				border-bottom-right-radius: 5px;				
				border-top-right-radius: 5px;
			}
			.user_item_button:hover {
				background-color: rgb(8, 128, 172);
				background-image: linear-gradient(rgb(18, 161, 214), rgb(4, 119, 162));
			}
			.user_item_button:active {
				background-color: rgb(1, 154, 210);
				background-image: linear-gradient(rgb(51, 188, 239), rgb(1, 154, 210));
			}
			.user_item_name {
			font-size:15px;
			color:rgb(19, 136, 210);
			padding-bottom:5px;
			padding-left:10px;
			padding-top:10px;
			}
			.user_item_info {
			font-size:13px;
			color:rgb(19, 136, 210);
			padding-bottom:2px;
			padding-left:10px;
			}
        </style>
    </head>
    <body class="body">
    	<div class="header">
        </div>
        <div class="main_form"> 
        	<div class="control_bar">
            	<button class="button_control"><a href="home.php">Home</a></button>
                <button class="button_control"><a href="../bus/logout.php">Sign out</a></button>
            </div>    
            <div class="slogan">Discover, connect and share with ...</div>                   
            <div class="content">   
            	<?php
                	require_once '../dao/membersdao.php';
                   	require_once '../dto/memberdto.php';
                  	require_once '../dao/connectiondao.php';
                   	$id = $_SESSION["Name"];
                    $listmember = connectiondao::getUserNoConnection($id);
                    //echo $listmember;
                    for($i=0;$i<count($listmember);$i++)
                    {
                    	$href = "../bus/connectusers.php?idfriend=".$listmember[$i]->getUserID();
						print"<div class='user_item'>";
							print"<div class='user_item_left'>";
								print"<div class='user_item_name'>".$listmember[$i]->getUserID()."</div>";
                                                                if($listmember[$i]->getGender())
                                                                    print"<div class='user_item_info'>Male</div>";
								else{
                                                                    print"<div class='user_item_info'>Female</div>";
                                                                }
								print"<div class='user_item_info'>".$listmember[$i]->getAge()." years old</div>";
							print"</div>";
							print"<div class='user_item_right'>";
								print"<button class='user_item_button'><a href='".$href."'>Add friend</a></button>";
							print"</div>";
						print"</div>";
                    }
                ?>
            </div>                     
        </div>
    </body>
</html>
